package com.sqs.config;

import com.sqs.constant.AIConstant;
import com.sqs.properties.AIProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.client.WebClient;

@Configuration
public class WebClientConfiguration {

    @Autowired
    private AIProperties aiProperties;

    @Bean
    public WebClient webClient(WebClient.Builder builder) {
        // 仅示例：将 baseUrl 留空或配置化
        return builder
                .baseUrl(aiProperties.getUrl())
                .defaultHeader(AIConstant.AUTHORIZATION, AIConstant.BEARER + aiProperties.getApiKey())
                .build();
    }
}